﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PermissionList.aspx.cs" Inherits="Medianamik.UI.SecurityManagement.PermissionList"
    MasterPageFile="../MasterPages/MedianamikModule.Master" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
	<asp:HyperLink runat="server" ID="ReturnLink" CssClass="Action BtAnnuler-Inactif" 
	    Text="<%$ Resources: Medianamik_Global,Cancel %>" />
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <telerik:RadTabStrip id="PermissionTabStrip" MultiPageID="PermissionMultiPage"
       runat="server" Skin="Medianamik" EnableEmbeddedSkins="false" CausesValidation="false" ShowBaseLine="True">
       <Tabs>
           <telerik:RadTab Text='<%$ Resources: medianamik_tabs, EditPermissions %>' PageViewID="EditPermissions" Selected="true" />
           <telerik:RadTab Text='<%$ Resources: medianamik_tabs, PreviewPermissions %>' PageViewID="PreviewPermissions" />
       </Tabs>
    </telerik:RadTabStrip>
    
    <telerik:RadMultiPage id="PermissionMultiPage" SelectedIndex="0" Runat="server" CssClass="TabPage">
        <telerik:RadPageView id="EditPermissions" runat="server" CssClass="ContainerEditeurPage">
            <table>
                <tr>
                    <td style="vertical-align:top"> 
                        <telerik:RadTreeView ID="FullArboTree" runat="server" Width="300px" Height="500px" 
                            OnClientNodeClicked="clientNodeClicked" >
                            <WebServiceSettings Path="/medianamik/services/contentmanager.asmx" Method="GetChildNodesForTreeView" />
                        </telerik:RadTreeView>
                    </td>
                    <td>&nbsp;</td>
                    <td style="vertical-align:top">
                        <h3><asp:Literal ID="SecurityManagementTitle" runat="server" Text='<%$ Resources: Medianamik_Tabs, SecurityManagementTitle %>' /></h3>
                        <med:NodePermissionSelector ID="NodePermissionSelector" runat="server" />
                    </td>
                </tr>
            </table>
        </telerik:RadPageView>
        
        <telerik:RadPageView id="PreviewPermissions" runat="server" CssClass="ContainerEditeurPage">
            <telerik:RadTreeView ID="SecurityPreviewTree" runat="server" Width="300px" Height="500px" />
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    
</asp:Content>

<asp:Content ID="ScriptContent" ContentPlaceHolderID="ScriptContentHolder" runat="server">
    <script type="text/javascript">
        //<![CDATA[

        function clientNodeClicked(sender, eventArgs) {
            var node = eventArgs.get_node();
            $find('<%=MyRadAjaxManager.ClientID%>')
                .ajaxRequestWithTarget('<%= NodePermissionSelector.ClientID %>',
                    node.get_value());
        }

        function nodePopulating(sender, eventArgs) {
            var node = eventArgs.get_node();
            var context = eventArgs.get_context();
            var attributes = node.get_attributes();
            context["CultureName"] = attributes.getAttribute("CultureName");
        }
                
        //]]>
    </script>
</asp:Content>